<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:xhtml />
<script type="text/javascript">
    function hideExcel(){
        $("#pathwayGeneExcel").toggle();
    }

    function fileTip(){
        $("#fileTip").dialog({
            autoOpen:true
        })
    }

    function textTip(){
        $("#textTip").dialog({
            autoOpen:true
        })
    }

    function useText(){
        $("#useText").show();
        $("#useFile").hide();
    }

    function useFile(){
        $("#useFile").show();
        $("#useText").hide();
    }

    function featureTip(){
        $("#featureTip").dialog({
            autoOpen:true
        })
    }
</script>
<div id="pathwayGene" class="content input">
    <h2><html:link style="float:left;" href="#" styleClass="ui-icon help ui-icon-info" onclick="featureTip()"></html:link>Kegg Pathway to Gene</h2>
    <html:errors property="geneSnp" />
    <html:errors property="geneList" />
    <html:form action="pathwayGene" enctype="multipart/form-data">
        <dl>
            <dt>How would you like to input pathways?</dt>
            <dd>
                <html:radio property="useTextarea" value="text" onclick="useText()">Text</html:radio>
                <html:radio property="useTextarea" value="file" onclick="useFile()">File Upload</html:radio>
            </dd>
        </dl>
        <logic:equal property="useTextarea" name="snpGeneForm" value="file">
            <div id="useFile" style="display:block">
            </logic:equal>
            <logic:notEqual property="useTextarea" name="snpGeneForm" value="file">
                <div id="useFile" style="display:none">
                </logic:notEqual>
                <dl>
                    <dt>Upload Pathway List:<html:link href="#" styleId="generalHelpButton" styleClass="ui-icon help ui-icon-info" onclick="fileTip()"></html:link></dt>
                    <dd class="ddpositionFix"><html:file property="file"/></dd>
                </dl>
            </div>

            <logic:equal property="useTextarea" name="snpGeneForm" value="text">
                <div id="useText" style="display:block">
                </logic:equal>
                <logic:notEqual property="useTextarea" name="snpGeneForm" value="text">
                    <div id="useText" style="display:none">
                    </logic:notEqual>
                    <dl>
                        <dt>Enter Pathway List:<html:link href="#" styleClass="ui-icon help ui-icon-info" onclick="textTip()"></html:link></dt>
                        <dd class="ddpositionFix"><html:textarea property="textInput"></html:textarea></dd>
                    </dl>
                </div>
                <dl>
                    <dt>Skip results page and export data?</dt>
                    <dd><html:checkbox property="excel" onclick="hideExcel()"/> (Recommended for large datasets)</dd>
                </dl>
                <logic:equal name="snpGeneForm" property="excel" value="true">
                    <div id="pathwayGeneExcel" style=" display: block">
                    </logic:equal>
                    <logic:notEqual name="snpGeneForm" property="excel" value="true">
                        <div id="pathwayGeneExcel" style=" display: none">
                        </logic:notEqual>
                        <dl>
                            <dt>Filename:</dt>
                            <dd><html:text property="filename"/></dd>
                            <dt>Delimiter:</dt>
                            <dd><html:select property="dlimiter">
                                    <html:option value="tab">Tab Delimited</html:option>
                                    <html:option value="csv">Comma Separated</html:option>
                                </html:select>
                            </dd>
                        </dl>
                    </div>

                    <html:submit value="Next" property="submitType" styleClass="button"/>
                </html:form>
            </div>
            <div id="featureTip" style="display:none">
                This feature takes a list of Kegg pathway names and returns all the genes that are in that pathway. The results are displayed on an interactive table with sorting, paging, and filtering capabilities.
            </div>
            <div id="fileTip" style="display:none">
                The file should be formatted as one Kegg Pathway Name per line.<br/>
                <br/>
                Accepts CSV, XLS, and Tab-delimited TXT files.
            </div>

            <div id="textTip" style="display:none">
                Text input should be formatted like:<br/>
                "Name of Kegg Pathway"<br/>
                <br/>
                For example: <br/>
                Asthma<br/>
            </div>